<?= $this->Html->css('slideshow', 'stylesheet', array('inline'=>false)) ?>
<?= $this->Html->script('slideshow', array('inline'=>false)) ?>

<?= $this->element('slideshow') ?>

<ul id="homepage-groups">
<? foreach ($homeGroups as $group): ?>
    <? if (! empty($group['Product'])): ?>
    <li>
        <h2><?= $this->Html->link($group['Group']['name'], '/products/index/' . $group['Group']['key']) ?></h2>
        <? foreach($group['Product'] as $product): ?>
        <?
            $productId  = $product['Product']['id'];
            $productSrc = @$product['ProductImage'][0]['src'];
        ?>
            <span class="item">
            <?= $this->Html->image("products/{$productId}/{$productSrc}?w=90&h=90", array(
                'url'   => '/products/view/' . $group['Group']['key'] . '/' . $product['Product']['id'] . '/' . urlize($product['Product']['name']),
                'alt'   => $product['Product']['name']
            )) ?>
            </span>
        <? endforeach ?>
    </li>
    <? endif ?>
<? endforeach ?>
</ul>